<template>
    <div class="orderTabs text-black-pk">
        <!--商品订单-->
        <van-tabs v-model="orderTypeActive"
                  @click="handleTabs"
                  title-active-color="#D82D11"
                  line-height="0"
                  :swipe-threshold="5"
                  background="#FFFFFF">
            <van-tab title="全部" name="0"></van-tab>
            <van-tab title="待付款" name="1"></van-tab>
            <van-tab title="待发货" name="2"></van-tab>
            <van-tab title="已发货" name="3"></van-tab>
            <van-tab title="待评价" name="4"></van-tab>
        </van-tabs>
    </div>
</template>
<script>
    export default {
        name: 'orderTabs',
        components: {},
        data() {
            return {
                orderTypeActive:this.$route.params.tabsType,
                status: this.$route.params.status,
        }
        },
        created() {
        },
        computed: {},
        watch: {},
        methods: {
            handleTabs() {
               this.goodsStatus();
               this.$emit("change", this.status)
            },
            /*普通商品订单
           * 状态订单：0未付款，1已付款未发货，2取消订单,
           * 3，已发货，4，确认收货，6已退款，
           * 7已申请退货，8已退货，10交易成功
           */
            goodsStatus() {
                switch (this.orderTypeActive) {
                    case "0":
                        this.status = "";
                        break;
                    case "1":
                        this.status =0;
                        break;
                    case "2":
                        this.status = 1;
                        break;
                    case "3":
                        this.status = 3;
                        break;
                    case "4":
                        this.status = 4;
                        break;
                }
            },
        }
    }
</script>

<style lang="scss" scoped>
    .orderTabs {
        background-color: #e9ecef;
        position: fixed;
        z-index: 1030;
        top: 45px;
        right: 0;
        left: 0;
    }

</style>
